package com.hlpedu.config;

import com.hlpedu.pojo.Fish;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * Java配置类
 */
@Configuration
@ComponentScan("com.hlpedu.pojo")
public class JavaConfig {
    @Bean("fish1")
    public Fish regoFish(){
        Fish fish=new Fish();
        fish.setName("大黄");
        return fish;
    }
    @Bean("fish2")
    public Fish createFish(){
        Fish fish=new Fish();
        fish.setName("小黄");
        return fish;
    }
}
